package com.stars.home.activity

import android.os.Bundle
import com.google.gson.Gson
import com.stars.home.base.MBActivity
import com.stars.home.databinding.ActivityMsgDetailsBinding
import com.stars.home.model.TrMsgList
import com.stars.home.vmodel.MsgDetailsVModel

/**
 *on 2022/9/23
 */
class MsgDetailsActivity : MBActivity<MsgDetailsVModel, ActivityMsgDetailsBinding>() {

    override fun init(savedInstanceState: Bundle?) {
        super.init(savedInstanceState)
        vm.index=intent?.extras?.getString("index")?.toInt()
        var data=intent?.extras?.getString("bean")

        vm.bean.value = Gson().fromJson(data, TrMsgList::class.java)
        //设置消息已读
        if(vm.bean.value?.isRead==0){
            vm.toSetRead(vm.bean.value?.id)
        }



    }

    override fun vmClass(): Class<MsgDetailsVModel> {
        return MsgDetailsVModel::class.java
    }
    override fun binding(): ActivityMsgDetailsBinding {
       return ActivityMsgDetailsBinding.inflate(layoutInflater)
    }

    override fun title(): String? {
        return "消息通知"
    }
}
